package com.android.Servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.android.Bean.WaterEleBean;

@SuppressWarnings("serial")
public class WaterEleViewServlet extends HttpServlet {

	/**
	 * 水电费查看
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setCharacterEncoding("gbk");
		WaterEleBean waterEleBean = new WaterEleBean();
		String genUID = request.getParameter("genUID");
		String json;
		try {
			json = waterEleBean.waterEleView(genUID);
			PrintWriter pw = response.getWriter();
			pw.append(json);
			pw.flush();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}

	}

}
